<?php
declare(strict_types=1);
namespace Service\UserService;

use App\Model\BbcModel\ShoppingGuide;
use Service\BaseService;
use Service\Code\Normal;

class ShoppingGuideService extends BaseService
{
    /**
     * 判断导购员是否存在
     * @param $guide_code
     * @return array
     */
    public static function getShoppingGuide($guide_code,$mn_sid,$cid)
    {
        $info = ShoppingGuide::instance()->info([
            'code'  => trim($guide_code),
            'mn_sid'=> $mn_sid,
            'cid'   => $cid
        ]);
        if(empty($info)){
            return Normal::returnCode(Normal::FAIL,'导购员不存在');
        }
        if($info['status']==0){
            return Normal::returnCode(Normal::FAIL,'导购员已禁用');
        }
        return Normal::returnCode(Normal::SUC,'获取成功',$info);
    }

}